<template>
	<div id="user">
		<div class="header_wrap">
			<span>
				<van-icon name="setting" size=".4rem"   @click="$router.push('/setting').catch(() =>{})"/>
			</span>
			<h1>会员中心</h1>
			<img :src="$url+'/'+user.icon">
			<p>您好，{{user.nikename}}</p>
		</div>
		<div class="dils">
			<p>
				<span>我的订单</span>
				<van-icon name="arrow" size="0.3rem" class="quit" @click="$router.push('/cart').catch(() =>{})" />
			</p>
			<van-grid :column-num="3">
				<van-grid-item v-for="(item,index) in list" :key="index" :icon="item.icon" :text="item.text" />
			</van-grid>
		</div>
	</div>
</template>

<script>
	export default {
		name: "user",
		data() {
			return {
				user: this.$route.query.data,
				list: [{
					text: "我的优惠券",
					icon: "gift-o"
				}, {
					text: "地址管理",
					icon: "location-o"
				}, {
					text: "我的收藏",
					icon: "star-o"
				}, {
					text: "公司简介",
					icon: "description"
				}, {
					text: "以旧换新",
					icon: "discount"
				}, {
					text: "充值/提现",
					icon: "pending-payment"
				}]
			}
		},
		mounted() {
		},
	}
</script>

<style>
	.header_wrap {
		text-align: center;
		background-image: url(../../public/img/bgc.jpg);
		background-repeat: no-repeat;
		background-size: cover;
		background-position: 0 0.9rem;
		position: relative;
	}

	.header_wrap span {
		display: block;
		position: absolute;
		top: 1.1rem;
		right: .2rem;
	}

	.header_wrap h1 {
		padding: 0.18rem;
		background-color: #fff;
		font-weight: 500;
	}

	.header_wrap img {
		width: 1.5rem;
		height: 1.5rem;
		border-radius: 0.75rem;
		margin: 1.3rem auto 0.2rem;
	}

	.header_wrap p {
		font-size: 0.35rem;
		padding: 0.2rem;
		color: #fff;
	}

	.dils p {
		display: flex;
		justify-content: space-between;
		padding: 0.2rem 0.3rem;
		font-size: 0.25rem;
		background-color: #fff;
		margin: 0.2rem 0;
	}
</style>
